Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for derivative metrics #22

Closed
wants to merge 3 commits into from
Closed

add support for derivative metrics #22

wants to merge 3 commits into from

Conversation

hollow
Copy link

@hollow hollow commented Sep 12, 2012

A derivative metric is like a meter but accepts an absolute counter as
input. This is useful for metrics like bytes sent over the network or
cpu cycles which are generally monotonically increasing counters and
therefore need to be derived from the previous sample to get a useful
rate/s value.

Benedikt Böhm added 3 commits September 12, 2012 12:27
A derivative metric is like a meter but accepts an absolute counter as
input. This is useful for metrics like bytes sent over the network or
cpu cycles which are generally monotonically increasing counters and
therefore need to be derived from the previous sample to get a useful
rate/s value.
module Metriks
class Derive < Metriks::Meter
def mark(val = 1)
@last ||= Atomic.new(val)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be initialized in the constructor to be threadsafe.

@eric
Copy link
Owner

eric commented Dec 7, 2012

I think we should make a derivative metric not inherit from Meter.

The things to consider are:

  1. How often is the derived metric going to be updated?
  2. How often is the reporter going to report on the metric?
  3. What should happen if the derived metric hasn't been updated since the last report?
  4. What should happen if the derived metric has been updated more than once since the last report?

With the Meter we have, we expect that we will be incrementing it as things happen, but with this derived metric, we are (I would guess) expecting to update it on a regular interval, so it has a lot of different implications.

@hollow
Copy link
Author

hollow commented Dec 11, 2012

In my case:

  1. every second
  2. just like for any other metric?

since i collect these metrics every second, i don't really care about the other two, but i would suggest something like:

  1. & 4. nothing or something invalid (like -∞)

probably do it similar to RRDtool, people are already familiar how DERIVE works with RRAs

@hollow hollow closed this Nov 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants